package com.liwang.lanouhn.nvshengo.activities;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.liwang.lanouhn.nvshengo.Info.MsgEvent;
import com.liwang.lanouhn.nvshengo.R;

import org.greenrobot.eventbus.EventBus;

/**
 * Created by lanouhn on 2016/10/24.
 */
public class SelfInformationActivity extends AppCompatActivity implements View.OnClickListener{
    private ImageView iv_back;
    private TextView tv_feature_title;
    private ImageView iv_ed1;
    private TextView tv_introduce;
    private EditText et_introduce;
    private ImageView iv_ed2;
    private Button btn_commit;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        int flag= WindowManager.LayoutParams.FLAG_FULLSCREEN;
        Window window=getWindow();
        window.setFlags(flag,flag);
        setContentView(R.layout.activity_selfinformation);
        initView();
    }

    private void initView() {
        iv_back = (ImageView) findViewById(R.id.iv_back);
        iv_back.setOnClickListener(this);
        tv_feature_title = (TextView) findViewById(R.id.tv_feature_title);
        iv_ed1 = (ImageView) findViewById(R.id.iv_ed1);
        tv_introduce = (TextView) findViewById(R.id.tv_introduce);
        et_introduce = (EditText) findViewById(R.id.et_introduce);
        iv_ed2 = (ImageView) findViewById(R.id.iv_ed2);
        btn_commit= (Button) findViewById(R.id.btn_commit);
        btn_commit.setOnClickListener(this);

    }


    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.iv_back:
                finish();
                break;
            case R.id.btn_commit:
                String text = String.valueOf(et_introduce.getText());
                EventBus.getDefault().post(new MsgEvent(text));
                finish();
                break;

        }
    }
}
